package com.example.jin.simpleplayer;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class simplePlayer extends AppCompatActivity {
    private Button btn_start, btn_stop;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        btn_start = (Button) findViewById(R.id.start);
        btn_start.setOnClickListener(StartIt);
        btn_stop = (Button) findViewById(R.id.stop);
        btn_stop.setOnClickListener(StopIt);
    }

    public Button.OnClickListener StartIt = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startService(new Intent("com.studio.android.START.AUDIO_SERVICE"));
        }
    };

    public Button.OnClickListener StopIt = new Button.OnClickListener() {
        @Override
        public void onClick(View v) {
            stopService(new Intent("com.studio.android.START.AUDIO_SERVICE"));
            finish();
        }
    };
}
